package com.cmict.data.bpm.framework.flowable.core.behavior.script.impl;

import com.cmict.data.bpm.dal.dataobject.definition.BpmTaskAssignRuleDO;
import com.cmict.data.bpm.enums.definition.BpmTaskRuleScriptEnum;
import org.flowable.engine.delegate.DelegateExecution;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

/**
 * 分配给发起人的一级 Leader 审批的 Script 实现类
 *
 * @author awesome
 */
@Component
public class BpmTaskAssignLeaderX1Script extends BpmTaskAssignLeaderAbstractScript {

    @Override
    public Set<Long> calculateTaskCandidateUsers(DelegateExecution execution, BpmTaskAssignRuleDO rule) {
//        Map<String, String> executionMap = new HashMap<>();
//        executionMap.put("processInstanceId", execution.getProcessInstanceId());
        return calculateTaskCandidateUsers(execution, 1);
    }

//    @Override
//    public Set<Long> calculateTaskCandidateUsers(Map<String, String> executionMap, BpmTaskAssignRuleDO rule) {
//        return calculateTaskCandidateUsers(executionMap, 1);
//    }

    @Override
    public BpmTaskRuleScriptEnum getEnum() {
        return BpmTaskRuleScriptEnum.LEADER_X1;
    }

}
